package cn.js.sip.rat.system.service.impl;

import cn.js.sip.rat.system.entity.ConfigInfoEntity;
import cn.js.sip.rat.system.mapper.ConfigInfoMapper;
import cn.js.sip.rat.system.service.SysConfigService;
import cn.js.sip.rat.system.util.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * @ClassName: cn.js.sip.rat.system.service.impl
 * @Description: TODO
 * @author: xuxiaoli
 * @Date: 2019-12-30   21:29
 */
@Service("sysConfigService")
public class SysConfigServiceImpl implements SysConfigService {

    @Resource
    private ConfigInfoMapper sysConfigMapper;
    @Override
    public String selectConfigByKey(String configKey) {
        ConfigInfoEntity config = new ConfigInfoEntity();
        config.setConfigKey(configKey);
        ConfigInfoEntity sysConfigEntity = sysConfigMapper.checkConfigKeyUnique(configKey);
        return StringUtils.isNotNull(sysConfigEntity) ? sysConfigEntity.getConfigValue() : "";
    }
}
